// http://docwiki.embarcadero.com/RADStudio/XE5/en/Compiler_Versions

{$DEFINE DELPHI_XX}

{$IFDEF FPC}
  {$MODE DELPHI}
  {$UNDEF DELPHI_XX}
{$ENDIF}

{$IFDEF VER80}
  {$DEFINE DELPHI1}
  {$UNDEF DELPHI_XX}
{$ENDIF}

{$IFDEF VER90}
  {$DEFINE DELPHI2}
  {$UNDEF DELPHI_XX}
{$ENDIF}

{$IFDEF VER100}
  {$DEFINE DELPHI3}
  {$UNDEF DELPHI_XX}
{$ENDIF}

{$IFDEF VER120}
  {$DEFINE DELPHI4}
  {$UNDEF DELPHI_XX}
{$ENDIF}

{$IFDEF VER130}
  {$DEFINE DELPHI5}
  {$UNDEF DELPHI_XX}
{$ENDIF}

{$IFDEF VER140}
  {$DEFINE DELPHI6}
  {$UNDEF DELPHI_XX}
{$ENDIF}

{$IFDEF VER150}
  {$DEFINE DELPHI7}
  {$UNDEF DELPHI_XX}
{$ENDIF}

{$IFDEF VER160}
  {$DEFINE DELPHI8}
  {$UNDEF DELPHI_XX}
{$ENDIF}

{$IFDEF VER170}
  {$DEFINE DELPHI9}
  {$DEFINE DELPHI2005}
  {$UNDEF DELPHI_XX}
{$ENDIF}

{$IFDEF VER180}
  {$DEFINE DELPHI11}
  {$DEFINE DELPHI2007}
  {$UNDEF DELPHI_XX} 
{$ENDIF}

{$IFDEF VER190}
  {$DEFINE DELPHI11}
  {$DEFINE DELPHI2007}
  {$UNDEF DELPHI_XX}     
{$ENDIF VER190}

{$IFDEF VER200}
  {$DEFINE DELPHI12}
  {$DEFINE DELPHI2009}
  {$UNDEF DELPHI_XX}
{$ENDIF VER200}

{$IFDEF VER210}
  {$DEFINE DELPHI14}
  {$DEFINE DELPHI2010}
  {$UNDEF DELPHI_XX}
{$ENDIF VER210}

{$IFDEF VER220}
  {$DEFINE DELPHI15}
  {$DEFINE DELPHI_XE}
  {$UNDEF DELPHI_XX}
{$ENDIF VER220}

{$IFDEF VER230}
  {$DEFINE DELPHI16}
  {$DEFINE DELPHI_XE2}
  {$UNDEF DELPHI_XX}
{$ENDIF VER220}

{$IFDEF VER240}
  {$DEFINE DELPHI17}
  {$DEFINE DELPHI_XE3}
  {$UNDEF DELPHI_XX}
{$ENDIF}

{$IFDEF VER250}
  {$DEFINE DELPHI18}
  {$DEFINE DELPHI_XE4}
  {$UNDEF DELPHI_XX}
{$ENDIF}

{$IFDEF VER260}
  {$DEFINE DELPHI19}
  {$DEFINE DELPHI_XE5}
  {$UNDEF DELPHI_XX}
{$ENDIF}

{$IFDEF DELPHI_XX}
  {$DEFINE DELPHI19}
  {$DEFINE DELPHI_XE5}
{$ENDIF}

{$IFDEF DELPHI19} {$DEFINE DELPHI19_UP} {$ENDIF}
{$IFDEF DELPHI18} {$DEFINE DELPHI18_UP} {$ENDIF}
{$IFDEF DELPHI17} {$DEFINE DELPHI17_UP} {$ENDIF}
{$IFDEF DELPHI16} {$DEFINE DELPHI16_UP} {$ENDIF}
{$IFDEF DELPHI15} {$DEFINE DELPHI15_UP} {$ENDIF}
{$IFDEF DELPHI14} {$DEFINE DELPHI14_UP} {$ENDIF}
{$IFDEF DELPHI12} {$DEFINE DELPHI12_UP} {$ENDIF}
{$IFDEF DELPHI11} {$DEFINE DELPHI11_UP} {$ENDIF}
{$IFDEF DELPHI10} {$DEFINE DELPHI10_UP} {$ENDIF}
{$IFDEF DELPHI9}  {$DEFINE DELPHI9_UP}  {$ENDIF}
{$IFDEF DELPHI8}  {$DEFINE DELPHI8_UP}  {$ENDIF}
{$IFDEF DELPHI7}  {$DEFINE DELPHI7_UP}  {$ENDIF}
{$IFDEF DELPHI6}  {$DEFINE DELPHI6_UP}  {$ENDIF}
{$IFDEF DELPHI5}  {$DEFINE DELPHI5_UP}  {$ENDIF}
{$IFDEF DELPHI4}  {$DEFINE DELPHI4_UP}  {$ENDIF}
{$IFDEF DELPHI3}  {$DEFINE DELPHI3_UP}  {$ENDIF}
{$IFDEF DELPHI2}  {$DEFINE DELPHI2_UP}  {$ENDIF}
{$IFDEF DELPHI1}  {$DEFINE DELPHI1_UP}  {$ENDIF}

{$IFDEF DELPHI19_UP} {$DEFINE DELPHI18_UP} {$ENDIF}
{$IFDEF DELPHI18_UP} {$DEFINE DELPHI17_UP} {$ENDIF}
{$IFDEF DELPHI17_UP} {$DEFINE DELPHI16_UP} {$ENDIF}
{$IFDEF DELPHI16_UP} {$DEFINE DELPHI15_UP} {$ENDIF}
{$IFDEF DELPHI15_UP} {$DEFINE DELPHI14_UP} {$ENDIF}
{$IFDEF DELPHI14_UP} {$DEFINE DELPHI13_UP} {$ENDIF}
{$IFDEF DELPHI13_UP} {$DEFINE DELPHI12_UP} {$ENDIF}
{$IFDEF DELPHI12_UP} {$DEFINE DELPHI11_UP} {$ENDIF}
{$IFDEF DELPHI11_UP} {$DEFINE DELPHI10_UP} {$ENDIF}
{$IFDEF DELPHI10_UP} {$DEFINE DELPHI9_UP}  {$ENDIF}
{$IFDEF DELPHI9_UP}  {$DEFINE DELPHI8_UP}  {$ENDIF}
{$IFDEF DELPHI8_UP}  {$DEFINE DELPHI7_UP}  {$ENDIF}
{$IFDEF DELPHI7_UP}  {$DEFINE DELPHI6_UP}  {$ENDIF}
{$IFDEF DELPHI6_UP}  {$DEFINE DELPHI5_UP}  {$ENDIF}
{$IFDEF DELPHI5_UP}  {$DEFINE DELPHI4_UP}  {$ENDIF}
{$IFDEF DELPHI4_UP}  {$DEFINE DELPHI3_UP}  {$ENDIF}
{$IFDEF DELPHI3_UP}  {$DEFINE DELPHI2_UP}  {$ENDIF}
{$IFDEF DELPHI2_UP}  {$DEFINE DELPHI1_UP}  {$ENDIF}

{$IFDEF DELPHI19_UP} {$DEFINE DELPHI_XE5_UP} {$ENDIF}
{$IFDEF DELPHI18_UP} {$DEFINE DELPHI_XE4_UP} {$ENDIF}
{$IFDEF DELPHI17_UP} {$DEFINE DELPHI_XE3_UP} {$ENDIF}
{$IFDEF DELPHI16_UP} {$DEFINE DELPHI_XE2_UP} {$ENDIF}
{$IFDEF DELPHI15_UP} {$DEFINE DELPHI_XE_UP}  {$ENDIF}
{$IFDEF DELPHI14_UP} {$DEFINE DELPHI2010_UP} {$ENDIF}
{$IFDEF DELPHI12_UP} {$DEFINE DELPHI2009_UP} {$ENDIF}
{$IFDEF DELPHI11_UP} {$DEFINE DELPHI2007_UP} {$ENDIF}
{$IFDEF DELPHI10_UP} {$DEFINE DELPHI2006_UP} {$ENDIF}
{$IFDEF DELPHI9_UP}  {$DEFINE DELPHI2005_UP} {$ENDIF}

{$IFDEF DELPHI2_UP}  {$DEFINE SUPPORTS_WIDECHAR}   {$ENDIF}
{$IFDEF DELPHI3_UP}  {$DEFINE SUPPORTS_WIDESTRING} {$ENDIF}
{$IFDEF DELPHI12_UP} {$DEFINE SUPPORTS_UNICODE}    {$ENDIF}

{$IFDEF FPC}
  {$DEFINE HAS_A4}
  {$DEFINE HAS_Z4}
  {$DEFINE HAS_ENUM_ORDINALITY} // Enumerated Types with Explicitly Assigned Ordinality
  {$DEFINE HAS_PATH_DELIM}
  {$DEFINE HAS_PPANSICHAR}
  {$DEFINE HAS_UTF8_ENCODE_DECODE}
  {$DEFINE HAS_WS_EX_TRANSPARENT}
  {$DEFINE HAS_OnContextPopup}
  {$DEFINE HAS_THANDLE}
  {$DEFINE HAS_FILE_EXISTS}
  {$DEFINE HAS_DIRECTORY_EXISTS}
  {$DEFINE HAS_SYNCOBJS}
{$ELSE}
  {$IFDEF DELPHI6_UP}
    {$DEFINE HAS_A4}
    {$DEFINE HAS_Z4}
    {$DEFINE HAS_ENUM_ORDINALITY} // Enumerated Types with Explicitly Assigned Ordinality
    {$DEFINE HAS_PATH_DELIM}
    {$DEFINE HAS_PPANSICHAR}
    {$DEFINE HAS_UTF8_ENCODE_DECODE}
    {$DEFINE HAS_WS_EX_TRANSPARENT}
    {$DEFINE HAS_OnContextPopup}
    {$DEFINE HAS_ParentBackground}
    {$DEFINE HAS_THANDLE}
    {$DEFINE HAS_FILE_EXISTS}
    {$DEFINE HAS_DIRECTORY_EXISTS}
    {$DEFINE HAS_SYNCOBJS}
  {$ENDIF}
{$ENDIF}

{$IFDEF HAS_A4}{$A4}{$ELSE}{$A+}{$ENDIF}
{$IFDEF HAS_Z4}{$Z4}{$ELSE}{$Z+}{$ENDIF}

{$IFNDEF MSWINDOWS}
  {$IFDEF WIN32}
    {$DEFINE MSWINDOWS}
  {$ENDIF}
{$ENDIF}

